home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / pctj1086.arc / READDIR1.ASM < prev    next >
Assembly Source File  |  1986-08-13  |  1KB  |  47 lines

  1. ;LISTING 1:  READDIR1.ASM
  2. ;
  3. ; This program reads the directory from the diskette in drive A
  4. ; into the memory area at DIRECTORY_BUFFER.  For the sake of
  5. ; simplicity no console input or output functions are performed
  6. ; by this program.
  7. ;
  8. CODESEG    SEGMENT    PARA   PUBLIC   'CODE'
  9. ;
  10.     ASSUME    CS:CODESEG,DS:CODESEG,ES:CODESEG,SS:CODESEG
  11. ;
  12.     ORG    0100H
  13. ;
  14. BEGIN:    JMP    READ_DIRECTORY
  15. ;
  16. ; ************************ Data Definitions **************************
  17. ;
  18. DIRECTORY_BUFFER    DB        3584 DUP (?)
  19. ;
  20. ; ************************  Main Procedure  **************************
  21. ;
  22. READ_DIRECTORY:
  23. ;
  24. ; Setup the registers for absolute disk read
  25. ;
  26.     MOV    AL,00H        ; Drive A
  27.     MOV    BX,OFFSET DIRECTORY_BUFFER    ; Point to the beginning
  28.                           ;    of the memory area
  29.     MOV    CX,0007H    ; 7 Sectors to be read
  30.     MOV    DX,0005H    ; Start at sector 5
  31.     INT    25H        ; Absolute Disk Read Interrupt
  32.     JC    ERROR_EXIT    ; Quit if there was an error
  33.     POPF            ; Restore the user flags
  34.     RET            ; Return to DOS
  35. ;
  36. ; Error return point -- error fixup or messages can go here
  37. ;
  38. ERROR_EXIT:
  39.     POP    DI        ; Throw away the user flags
  40.     RET            ; Return to DOS
  41. ;
  42. CODESEG    ENDS
  43. ;
  44. ; ********************************************************************
  45. ;
  46.     END    BEGIN
  47.